#include<iostream>
using namespace std;

int* func()
{
	int* p = new int(10);
	return p;
}

int* arr()
{
	int* p = new int[10];
	for (int i = 0; i < 10; i++) {
		p[i] = i + 100;
	}
	return p;
}

int main()
{
	//int* p = func();
//	cout << *p << endl;
	//cout << *p << endl;

	int* p = arr();
	for (int i = 0; i < 10; i++) {
		cout << p[i] << endl;
	}
	delete p;
	for (int i = 0; i < 10; i++) {
		cout << p[i] << endl;
	}


	system("pause");
	return 0;
}